/*
 * Bomb.h
 *
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses 
 */

#ifndef BOMB_H_
#define BOMB_H_

#include "Observable.h"
#include "Positionable.h"
#include "Map.h"
#include "Identifiable.h"
#include "MapEffect.h"
#include "MapObject.h"
#include "Clonable.h"

// Clase base para las bombas

class Bomb: virtual public Observable,
            virtual public Positionable,
            virtual public Identifiable,
            virtual public Clonable {
protected:
    int damage;
    bool triggered;
    int range;
    MapObject* owner;

public:
    Bomb();
    Bomb(int x, int y);
    Bomb(int id, int x, int y);
    Bomb(int x, int y, MapObject* owner);
    Bomb(int id, int x, int y, MapObject* owner);
    int getDamage();
    int getRange();
    bool isTriggered();
    void trigger();
    MapObject* getOwner();
    void setOwner(MapObject* owner);
    // Notifica el evento BOMB_EXPLODED
    virtual void explode();
    // Devuelve un MapEffect* correspondiente a la explosión de la bomba
    virtual MapEffect* getExplosionEffect();
    virtual Bomb* clone();
    virtual ~Bomb();
private:
    void init();
};

#endif /* BOMB_H_ */
